-
Notifications
You must be signed in to change notification settings - Fork 5.3k
mm/mempolicy: Ignore runtime policy changes when set through cmdline #6740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
pelwell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either I've misunderstood or the commit message seems backwards. Where it says "force the default numa mode (and so ignore policy changes)", it looks more like "ignore policy changes (and so force the default numa mode)", although the "default" is MPOL_INTERLEAVE, is not MPOL_DEFAULT.
mm/mempolicy.c
Outdated
|
|
||
| #include "internal.h" | ||
|
|
||
| /* bit field to force hotplug detection. bit0 = HDMI0 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops - updated comment.
|
It prevents run-time switching of the mempolicy, so the default policy chosen through cmdline.txt (which we set to I want to prevent changes using numactl (and similar) userside apis. I'm happy to switch to a preferred wording. |
|
How about: |
|
An alternative would be to treat any I believe that is the behaviour that makes sense for most users (if bootloader expects numa to be enabled and so sets BANKLOW=1, and we disable numa, performance is bad). |
|
I think I prefer that logic. |
|
Updated. Slightly annoying we do get some messages from a normal boot: 5=MPOL_PREFERRED_MANY 3=MPOL_INTERLEAVE. Ignoring these is reasonable, but the spam is unfortunate. |
|
Short of adding a time check, or perhaps some check on the calling process, I don't think there's much we can do about that. |
|
Options are: Any preference? |
|
How about muting them for the first 30-40 seconds? That would get us past the boot. |
83fdcdd to
5dcc6a4
Compare
|
Okay, gone for the "ignore first 40 seconds" of boot option. |
Some apps like linpack use numa_setpolicy to disable numa, but that tends to have a significant performance hit for us. If you have a cmdline.txt setting of numa_policy (to something other than default), then lets ignore runtime changes and stick with the cmdline.txt setting. Not specifying numa_setpolicy in cmdline, or setting numa_setpolicy=default(*) will allow runtime settings to work. (*) easier to do when numa_setpolicy=interleave is set in DT. Ignore logging for the first 40 seconds as there are some expected switches during boot. Signed-off-by: Dom Cobley <[email protected]>
|
I've reduced the debug message a little (I think only the mode set is actually interesting). |
…cmdline See: raspberrypi/linux#6740 kernel: Disable DMA for Pi 5's UART0 See: raspberrypi/linux#6742
…cmdline See: raspberrypi/linux#6740 kernel: Disable DMA for Pi 5's UART0 See: raspberrypi/linux#6742
Some apps like linpack call numa_setpolicy to disable numa, but that tends to have a significant performance hit for us.
Add an option to force the default numa mode (and so ignore policy changes) for now.
Consider making this the default behaviour in the future.
Use mempolicy.force_numa=1 in cmdline.txt or
echo 1 | sudo tee /sys/module/mempolicy/parameters/force_numa
to force the default numa policy.